import type { MockMethod } from 'vite-plugin-mock';
import config from '../../_config';

export default [
	{
		url: '/role/getRolesByUserId',
		method: 'get',
		timeout: config.timeout,
		response: ({ query, body }) => {
			return {
				code: config.resultCode,
				message: 'success',
				results: [
					{
						id: 4,
						authorizeMs: null,
						name: '角色名称1',
						description: '',
						roleType: null,
						status: null,
						enterpriseId: null,
						createUserId: null,
						createDate: null,
						modifyUserId: null,
						modifyDate: null,
						authIds: null,
						createUserName: null,
					},
					{
						id: 5,
						authorizeMs: null,
						name: '角色名称2',
						description: '',
						roleType: null,
						status: null,
						enterpriseId: null,
						createUserId: null,
						createDate: null,
						modifyUserId: null,
						modifyDate: null,
						authIds: null,
						createUserName: null,
					},
				],
			};
		},
	},
	{
		url: '/role/getRoleMByPage',
		method: 'post',
		timeout: config.timeout,
		response: ({ query, body }) => {
			return {
				code: config.resultCode,
				message: 'success',
				results: config.pageData({
					data: [
						{
							authorizeMs: null,
							authIds: [1, 2, 3, 4, 5, 6, 21, 22],
							userId: null,
							name: 'role2',
							description: '',
							roleType: 'normal',
							status: 0,
							createUserId: 1,
							createUserName: 'admin',
							createDate: 1684201541991,
							createDateLong: null,
							id: 3,
						},
						{
							authorizeMs: null,
							authIds: [1],
							userId: null,
							name: 'role1',
							description: '',
							roleType: 'normal',
							status: 0,
							createUserId: 1,
							createUserName: 'admin',
							createDate: 1684145102741,
							createDateLong: null,
							id: 2,
						},
					],
				}),
			};
		},
	},
	{
		url: '/role/insertRole',
		method: 'post',
		timeout: config.timeout,
		response: ({ query, body }) => {
			return {
				code: config.resultCode,
				message: 'success',
				results: null,
			};
		},
	},
	{
		url: '/role/updateRoleMById',
		method: 'post',
		timeout: config.timeout,
		response: ({ query, body }) => {
			return {
				code: config.resultCode,
				message: 'success',
				results: null,
			};
		},
	},
	{
		url: '/role/deleteRoleById',
		method: 'post',
		timeout: config.timeout,
		response: ({ query, body }) => {
			return {
				code: config.resultCode,
				message: 'success',
				results: null,
			};
		},
	},
	{
		url: '/role/updateRoleMStatus',
		method: 'post',
		timeout: config.timeout,
		response: ({ query, body }) => {
			return {
				code: config.resultCode,
				message: 'success',
				results: null,
			};
		},
	},
] as MockMethod[];
